﻿
function Pop(id,width,height){
            divCover();
            var dialog=$(id);
            var os=dialog.style;
            os.position="absolute";
            os.top=(document.body.offsetHeight/2-height/2)+"px";
            os.left=(document.body.offsetWidth/2-width/2)+"px";
            os.zIndex="100";
            os.display="block";
        }
        
function divCover(){
            var over=$("divOver");
            if(!over){
                over=document.createElement("div");
            }
            over.id="divOver";
            var oS=over.style;
            oS.left="0px";
            oS.top="0px";
            oS.position = "absolute";
            oS.zIndex = "1";
            var height=document.body.scrollHeight+20;
            if((window.screen.availHeight-window.screenTop-24)>height){
                height= window.screen.availHeight-window.screenTop-24;
            }
            height=height+"px";
            var width=window.screen.availWidth;
//            if(ie) width=window.screen.availWidth-20;
//            width=width+"px";
            over.innerHTML = "<table width="+width+" height="+height+" style='background-color:black; filter: Alpha(Opacity=40);-moz-opacity:0.4;'></div>";
            document.body.appendChild(over);
        }
function CloseImg(){
            Hide($("imgTip"));
            HidePop("divImg");
        }
        
function HidePop(divID){
            $(divID).style.display="none";
            hideOver();
        }
 
 function Hide(obj){
	        obj.style.display="none";
        }
        
 function hideOver(){
            var over=$("divOver");
            if(over){
                over.innerHTML="";
            }
            
        }
        
function CloseFile()
{
    HidePop("divfile");
}